﻿// Decompiled with JetBrains decompiler
// Type: YJM_PTO.FrmShowNumOrPassWord
// Assembly: YJM_PTO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 17EE8669-AD07-48C9-A340-87C7401F98C3
// Assembly location: C:\Users\Administrator\Desktop\bin\YJM_PTO.exe

using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;


namespace YJM_PTO
{
  public class FrmShowNumOrPassWord : Form
  {
    public string inTxt = "";
    public bool isOK = false;
    private string operTypr = "";
    private IContainer components = (IContainer) null;
    private Button btn;
    private Label lbl;
    private TextBox txtBox;

    public FrmShowNumOrPassWord(string type)
    {
      this.InitializeComponent();
      this.operTypr = type.ToLower();
    }

    private void FrmShowNumOrPassWord_Load(object sender, EventArgs e)
    {
      this.isOK = false;
      if (this.operTypr == "num")
      {
        this.Text = "数量";
        this.txtBox.Text = "100";
        this.lbl.Text = "数量：";
      }
      else
      {
        if (!(this.operTypr == "pword"))
          return;
        this.txtBox.PasswordChar = '*';
        this.Text = "输入密码";
        this.txtBox.Text = "";
        this.lbl.Text = "输入密码:";
      }
    }

    private void btn_Click(object sender, EventArgs e)
    {
      string s = this.txtBox.Text.Trim();
      this.inTxt = s;
      if (this.operTypr == "num")
      {
        if (string.IsNullOrEmpty(s))
        {
          int num1 = (int) MessageBox.Show("数量不能为空，必须为正整数！");
        }
        else
        {
          int result = 0;
          if (!int.TryParse(s, out result))
          {
            int num2 = (int) MessageBox.Show("数量不必须为正整数！请重新输入！");
          }
          else
          {
            this.isOK = true;
            this.Close();
          }
        }
      }
      else
      {
        if (!(this.operTypr == "pword"))
          return;
        if (string.IsNullOrEmpty(s))
        {
          int num3 = (int) MessageBox.Show("密码不能为空！");
        }
        else if (string.Join<char>("", DateTime.Now.ToString("yyyyMMdd").Reverse<char>()) != s)
        {
          int num4 = (int) MessageBox.Show("密码错误！请重新输入！");
        }
        else
        {
          this.isOK = true;
          this.Close();
        }
      }
    }

    protected override void Dispose(bool disposing)
    {
      if (disposing && this.components != null)
        this.components.Dispose();
      base.Dispose(disposing);
    }

    private void InitializeComponent()
    {
      this.btn = new Button();
      this.lbl = new Label();
      this.txtBox = new TextBox();
      this.SuspendLayout();
      this.btn.Location = new Point(309, 54);
      this.btn.Margin = new Padding(4, 4, 4, 4);
      this.btn.Name = "btn";
      this.btn.Size = new Size(81, 29);
      this.btn.TabIndex = 14;
      this.btn.Text = "确定";
      this.btn.UseVisualStyleBackColor = true;
      this.btn.Click += new EventHandler(this.btn_Click);
      this.lbl.AutoSize = true;
      this.lbl.Location = new Point(25, 58);
      this.lbl.Margin = new Padding(4, 0, 4, 0);
      this.lbl.Name = "lbl";
      this.lbl.Size = new Size(82, 15);
      this.lbl.TabIndex = 16;
      this.lbl.Text = "下载数量：";
      this.txtBox.Location = new Point(112, 54);
      this.txtBox.Margin = new Padding(4, 4, 4, 4);
      this.txtBox.Name = "txtBox";
      this.txtBox.Size = new Size(183, 25);
      this.txtBox.TabIndex = 17;
      this.AutoScaleDimensions = new SizeF(8f, 15f);
      this.AutoScaleMode = AutoScaleMode.Font;
      this.BackColor = SystemColors.Control;
      this.ClientSize = new Size(425, 148);
      this.Controls.Add((Control) this.txtBox);
      this.Controls.Add((Control) this.lbl);
      this.Controls.Add((Control) this.btn);
      this.Margin = new Padding(4, 4, 4, 4);
      this.MaximizeBox = false;
      this.MinimizeBox = false;
      this.Name = "FrmShowNumOrPassWord";
      this.StartPosition = FormStartPosition.CenterParent;
      this.Text = "FrmShowNumOrPassWord";
      this.Load += new EventHandler(this.FrmShowNumOrPassWord_Load);
      this.ResumeLayout(false);
      this.PerformLayout();
    }
  }
}
